<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>循环数组</title>
    <link type="text/css" rel="stylesheet" href="../css/bootstrap.min.css"/>
</head>
<body ng-app="iterateArray">
<script type="text/javascript" src="../js/angular.min.js"></script>
<script type="text/javascript" src="../js/iterateArray.js"></script>
<div ng-controller="deck as d">
    <table class="table table-hover" ng-show="d.minions.length > 0">
        <thead>
        <tr>
            <th>卡牌名称</th>
            <th>费用</th>
            <th>攻击力</th>
            <th>生命值</th>
            <th>特殊能力</th>
        </tr>
        </thead>
        <tbody ng-repeat="m in d.minions">
        <tr>
            <td>{{m.name}}</td>
            <td>{{m.cost}}</td>
            <td>{{m.attack}}</td>
            <td>{{m.life}}</td>
            <td>{{m.ability}}</td>
        </tr>
        </tbody>
        <tfoot>
        <tr>
            <td colspan="4">总数</td>
            <td>{{d.minions.length}}</td>
        </tr>
        </tfoot>
    </table>
</div>
</body>
</html>